<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>HTML 辅助函数 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档</title>
  

  
  
  <link rel="shortcut icon" href="../_static/ci-icon.ico" />
  

  
  <link href="../_static/css/fonts.css" rel="stylesheet" type="text/css" />

  
  
    

  

  
  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  

  
  <link rel="stylesheet" href="../_static/css/theme_cn.css" type="text/css" />
    <link rel="top" title="CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" href="../index.html"/>
        <link rel="up" title="辅助函数参考" href="index.html"/>
        <link rel="next" title="Inflector 辅助函数" href="inflector_helper.html"/>
        <link rel="prev" title="表单辅助函数" href="form_helper.html"/> 

  
  <script src="../_static/js/modernizr.2.6.2.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div id="nav">
  <div id="nav_inner">
    
    
    
      <div id="pulldown-menu" class="ciNav">
        <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">类库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">输入类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">数据库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">数据库工具类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">辅助函数参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

      </div>
    
      
  </div>
</div>
<div id="nav2">
  <a href="#" id="openToc">
    <img src="" title="切换目录" alt="切换目录" />
  </a>
</div>

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-nav-search">
        
          <a href="../index.html" class="fa fa-home"> CodeIgniter</a>
        
        
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="搜索手册" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
        
          
          
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">类库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">输入类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">数据库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">数据库工具类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">辅助函数参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

          
        
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../index.html">CodeIgniter</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../index.html">首页</a> &raquo; </li>
    
    <li><a href="index.html">辅助函数参考</a> &raquo; </li>
    
    <li>HTML 辅助函数</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
    <div style="float:right;">
      <div style="text-decoration:underline;color:blue;margin-left:5px;cursor:pointer;" id="closeMe">
        <img title="目录" alt="toc" src="" />
      </div>
    </div>
  </ul>
  <hr/>
</div>
          <div role="main" class="document">
            
  <div class="section" id="html">
<h1>HTML 辅助函数<a class="headerlink" href="#html" title="永久链接至标题">¶</a></h1>
<p>HTML 辅助函数文件包含了用于处理 HTML 的一些函数。</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#id1" id="id3">加载辅助函数</a></li>
<li><a class="reference internal" href="#id2" id="id4">可用函数</a></li>
</ul>
</div>
<div class="custom-index container"></div><div class="section" id="id1">
<h2><a class="toc-backref" href="#id3">加载辅助函数</a><a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
<p>该辅助函数通过下面的代码加载:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">helper</span><span class="p">(</span><span class="s1">&#39;html&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h2><a class="toc-backref" href="#id4">可用函数</a><a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
<p>该辅助函数有下列可用函数：</p>
<dl class="function">
<dt id="heading">
<tt class="descname">heading</tt><big>(</big><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$h = '1'</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#heading" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$data</strong> (<em>string</em>) -- Content</li>
<li><strong>$h</strong> (<em>string</em>) -- Heading level</li>
<li><strong>$attributes</strong> (<em>mixed</em>) -- HTML attributes</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML heading tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于创建 HTML 标题标签，第一个参数为标题内容，第二个参数为标题大小。例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">&#39;Welcome!&#39;</span><span class="p">,</span> <span class="mi">3</span><span class="p">);</span>
</pre></div>
</div>
<p>上面代码将生成：&lt;h3&gt;Welcome!&lt;/h3&gt;</p>
<p>另外，为了向标题标签添加属性，例如 HTML class、id 或内联样式，可以通过第三个参数传一个字符串或者一个数组:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">&#39;Welcome!&#39;</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">&#39;class=&quot;pink&quot;&#39;</span><span class="p">);</span>
<span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">&#39;How are you?&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;question&#39;</span><span class="p">,</span> <span class="s1">&#39;class&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;green&#39;</span><span class="p">));</span>
</pre></div>
</div>
<p>上面代码将生成：</p>
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;h3</span> <span class="na">class=</span><span class="s">&quot;pink&quot;</span><span class="nt">&gt;</span>Welcome!<span class="nt">&lt;h3&gt;</span>
<span class="nt">&lt;h4</span> <span class="na">id=</span><span class="s">&quot;question&quot;</span> <span class="na">class=</span><span class="s">&quot;green&quot;</span><span class="nt">&gt;</span>How are you?<span class="nt">&lt;/h4&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="img">
<tt class="descname">img</tt><big>(</big><span class="optional">[</span><em>$src = ''</em><span class="optional">[</span>, <em>$index_page = FALSE</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#img" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$src</strong> (<em>string</em>) -- Image source data</li>
<li><strong>$index_page</strong> (<em>bool</em>) -- Whether to treat $src as a routed URI string</li>
<li><strong>$attributes</strong> (<em>array</em>) -- HTML attributes</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML image tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于生成 HTML &lt;img /&gt; 标签，第一个参数为图片地址，例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">img</span><span class="p">(</span><span class="s1">&#39;images/picture.jpg&#39;</span><span class="p">);</span> <span class="c1">// gives &lt;img src=&quot;http://site.com/images/picture.jpg&quot; /&gt;</span>
</pre></div>
</div>
<p>第二个参数可选，其值为 TRUE 或 FALSE，用于指定是否在生成的图片地址中添加由 <tt class="docutils literal"><span class="pre">$config['index_page']</span></tt> 所设置的起始页面。
一般来说，当你使用媒体控制器时才使用这个:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">img</span><span class="p">(</span><span class="s1">&#39;images/picture.jpg&#39;</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="c1">// gives &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;&quot; /&gt;</span>
</pre></div>
</div>
<p>另外，你也可以通过向 <tt class="docutils literal"><span class="pre">img()</span></tt> 函数传递一个关联数组来完全控制所有的属性和值，如果没有提供 <em>alt</em> 属性，
CodeIgniter 默认使用一个空字符串。</p>
<p>例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$image_properties</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;src&#39;</span>   <span class="o">=&gt;</span> <span class="s1">&#39;images/picture.jpg&#39;</span><span class="p">,</span>
    <span class="s1">&#39;alt&#39;</span>   <span class="o">=&gt;</span> <span class="s1">&#39;Me, demonstrating how to eat 4 slices of pizza at one time&#39;</span><span class="p">,</span>
    <span class="s1">&#39;class&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;post_images&#39;</span><span class="p">,</span>
    <span class="s1">&#39;width&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;200&#39;</span><span class="p">,</span>
    <span class="s1">&#39;height&#39;</span><span class="o">=&gt;</span> <span class="s1">&#39;200&#39;</span><span class="p">,</span>
    <span class="s1">&#39;title&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;That was quite a night&#39;</span><span class="p">,</span>
    <span class="s1">&#39;rel&#39;</span>   <span class="o">=&gt;</span> <span class="s1">&#39;lightbox&#39;</span>
<span class="p">);</span>

<span class="nx">img</span><span class="p">(</span><span class="nv">$image_properties</span><span class="p">);</span>
<span class="c1">// &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;Me, demonstrating how to eat 4 slices of pizza at one time&quot; class=&quot;post_images&quot; width=&quot;200&quot; height=&quot;200&quot; title=&quot;That was quite a night&quot; rel=&quot;lightbox&quot; /&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="link_tag">
<tt class="descname">link_tag</tt><big>(</big><span class="optional">[</span><em>$href = ''</em><span class="optional">[</span>, <em>$rel = 'stylesheet'</em><span class="optional">[</span>, <em>$type = 'text/css'</em><span class="optional">[</span>, <em>$title = ''</em><span class="optional">[</span>, <em>$media = ''</em><span class="optional">[</span>, <em>$index_page = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#link_tag" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$href</strong> (<em>string</em>) -- What are we linking to</li>
<li><strong>$rel</strong> (<em>string</em>) -- Relation type</li>
<li><strong>$type</strong> (<em>string</em>) -- Type of the related document</li>
<li><strong>$title</strong> (<em>string</em>) -- Link title</li>
<li><strong>$media</strong> (<em>string</em>) -- Media type</li>
<li><strong>$index_page</strong> (<em>bool</em>) -- Whether to treat $src as a routed URI string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML link tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于生成 HTML &lt;link /&gt; 标签，这在生成样式的 link 标签时很有用，当然也可以生成其他的 link 标签。
参数为 <em>href</em> ，后面的是可选的：<em>rel</em> 、 <em>type</em> 、 <em>title</em> 、 <em>media</em> 和 <em>index_page</em> 。</p>
<p><em>index_page</em> 参数是个布尔值，用于指定是否在 <em>href</em> 链接中添加由 <tt class="docutils literal"><span class="pre">$config['index_page']</span></tt> 所设置的起始页面。</p>
<p>例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">&#39;css/mystyles.css&#39;</span><span class="p">);</span>
<span class="c1">// gives &lt;link href=&quot;http://site.com/css/mystyles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</span>
</pre></div>
</div>
<p>另一个例子:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">&#39;favicon.ico&#39;</span><span class="p">,</span> <span class="s1">&#39;shortcut icon&#39;</span><span class="p">,</span> <span class="s1">&#39;image/ico&#39;</span><span class="p">);</span>
<span class="c1">// &lt;link href=&quot;http://site.com/favicon.ico&quot; rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; /&gt;</span>

<span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">&#39;feed&#39;</span><span class="p">,</span> <span class="s1">&#39;alternate&#39;</span><span class="p">,</span> <span class="s1">&#39;application/rss+xml&#39;</span><span class="p">,</span> <span class="s1">&#39;My RSS Feed&#39;</span><span class="p">);</span>
<span class="c1">// &lt;link href=&quot;http://site.com/feed&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;My RSS Feed&quot; /&gt;</span>
</pre></div>
</div>
<p>另外，你也可以通过向 <tt class="docutils literal"><span class="pre">link()</span></tt> 函数传递一个关联数组来完全控制所有的属性和值:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$link</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;href&#39;</span>  <span class="o">=&gt;</span> <span class="s1">&#39;css/printer.css&#39;</span><span class="p">,</span>
    <span class="s1">&#39;rel&#39;</span>   <span class="o">=&gt;</span> <span class="s1">&#39;stylesheet&#39;</span><span class="p">,</span>
    <span class="s1">&#39;type&#39;</span>  <span class="o">=&gt;</span> <span class="s1">&#39;text/css&#39;</span><span class="p">,</span>
    <span class="s1">&#39;media&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;print&#39;</span>
<span class="p">);</span>

<span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="nv">$link</span><span class="p">);</span>
<span class="c1">// &lt;link href=&quot;http://site.com/css/printer.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="ul">
<tt class="descname">ul</tt><big>(</big><em>$list</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#ul" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$list</strong> (<em>array</em>) -- List entries</li>
<li><strong>$attributes</strong> (<em>array</em>) -- HTML attributes</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML-formatted unordered list</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于生成 HTML 无序列表（&lt;ul&gt;），参数为简单的数组或者多维数组。例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$list</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;red&#39;</span><span class="p">,</span>
    <span class="s1">&#39;blue&#39;</span><span class="p">,</span>
    <span class="s1">&#39;green&#39;</span><span class="p">,</span>
    <span class="s1">&#39;yellow&#39;</span>
<span class="p">);</span>

<span class="nv">$attributes</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;class&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;boldlist&#39;</span><span class="p">,</span>
    <span class="s1">&#39;id&#39;</span>    <span class="o">=&gt;</span> <span class="s1">&#39;mylist&#39;</span>
<span class="p">);</span>

<span class="k">echo</span> <span class="nx">ul</span><span class="p">(</span><span class="nv">$list</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span>
</pre></div>
</div>
<p>上面的代码将生成：</p>
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;boldlist&quot;</span> <span class="na">id=</span><span class="s">&quot;mylist&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;li&gt;</span>red<span class="nt">&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;</span>blue<span class="nt">&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;</span>green<span class="nt">&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;</span>yellow<span class="nt">&lt;/li&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
</pre></div>
</div>
<p>下面是个更复杂的例子，使用了多维数组:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$attributes</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;class&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;boldlist&#39;</span><span class="p">,</span>
    <span class="s1">&#39;id&#39;</span>    <span class="o">=&gt;</span> <span class="s1">&#39;mylist&#39;</span>
<span class="p">);</span>

<span class="nv">$list</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;colors&#39;</span>  <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;red&#39;</span><span class="p">,</span>
        <span class="s1">&#39;blue&#39;</span><span class="p">,</span>
        <span class="s1">&#39;green&#39;</span>
    <span class="p">),</span>
    <span class="s1">&#39;shapes&#39;</span>  <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;round&#39;</span><span class="p">,</span>
        <span class="s1">&#39;square&#39;</span><span class="p">,</span>
        <span class="s1">&#39;circles&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
            <span class="s1">&#39;ellipse&#39;</span><span class="p">,</span>
            <span class="s1">&#39;oval&#39;</span><span class="p">,</span>
            <span class="s1">&#39;sphere&#39;</span>
        <span class="p">)</span>
    <span class="p">),</span>
    <span class="s1">&#39;moods&#39;</span>  <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;happy&#39;</span><span class="p">,</span>
        <span class="s1">&#39;upset&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
            <span class="s1">&#39;defeated&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
                <span class="s1">&#39;dejected&#39;</span><span class="p">,</span>
                <span class="s1">&#39;disheartened&#39;</span><span class="p">,</span>
                <span class="s1">&#39;depressed&#39;</span>
            <span class="p">),</span>
            <span class="s1">&#39;annoyed&#39;</span><span class="p">,</span>
            <span class="s1">&#39;cross&#39;</span><span class="p">,</span>
            <span class="s1">&#39;angry&#39;</span>
        <span class="p">)</span>
    <span class="p">)</span>
<span class="p">);</span>

<span class="k">echo</span> <span class="nx">ul</span><span class="p">(</span><span class="nv">$list</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span>
</pre></div>
</div>
<p>上面的代码将生成：</p>
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;boldlist&quot;</span> <span class="na">id=</span><span class="s">&quot;mylist&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;li&gt;</span>colors
        <span class="nt">&lt;ul&gt;</span>
            <span class="nt">&lt;li&gt;</span>red<span class="nt">&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;</span>blue<span class="nt">&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;</span>green<span class="nt">&lt;/li&gt;</span>
        <span class="nt">&lt;/ul&gt;</span>
    <span class="nt">&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;</span>shapes
        <span class="nt">&lt;ul&gt;</span>
            <span class="nt">&lt;li&gt;</span>round<span class="nt">&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;</span>suare<span class="nt">&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;</span>circles
                <span class="nt">&lt;ul&gt;</span>
                    <span class="nt">&lt;li&gt;</span>elipse<span class="nt">&lt;/li&gt;</span>
                    <span class="nt">&lt;li&gt;</span>oval<span class="nt">&lt;/li&gt;</span>
                    <span class="nt">&lt;li&gt;</span>sphere<span class="nt">&lt;/li&gt;</span>
                <span class="nt">&lt;/ul&gt;</span>
            <span class="nt">&lt;/li&gt;</span>
        <span class="nt">&lt;/ul&gt;</span>
    <span class="nt">&lt;/li&gt;</span>
    <span class="nt">&lt;li&gt;</span>moods
        <span class="nt">&lt;ul&gt;</span>
            <span class="nt">&lt;li&gt;</span>happy<span class="nt">&lt;/li&gt;</span>
            <span class="nt">&lt;li&gt;</span>upset
                <span class="nt">&lt;ul&gt;</span>
                    <span class="nt">&lt;li&gt;</span>defeated
                        <span class="nt">&lt;ul&gt;</span>
                            <span class="nt">&lt;li&gt;</span>dejected<span class="nt">&lt;/li&gt;</span>
                            <span class="nt">&lt;li&gt;</span>disheartened<span class="nt">&lt;/li&gt;</span>
                            <span class="nt">&lt;li&gt;</span>depressed<span class="nt">&lt;/li&gt;</span>
                        <span class="nt">&lt;/ul&gt;</span>
                    <span class="nt">&lt;/li&gt;</span>
                    <span class="nt">&lt;li&gt;</span>annoyed<span class="nt">&lt;/li&gt;</span>
                    <span class="nt">&lt;li&gt;</span>cross<span class="nt">&lt;/li&gt;</span>
                    <span class="nt">&lt;li&gt;</span>angry<span class="nt">&lt;/li&gt;</span>
                <span class="nt">&lt;/ul&gt;</span>
            <span class="nt">&lt;/li&gt;</span>
        <span class="nt">&lt;/ul&gt;</span>
    <span class="nt">&lt;/li&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="ol">
<tt class="descname">ol</tt><big>(</big><em>$list</em>, <em>$attributes = ''</em><big>)</big><a class="headerlink" href="#ol" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$list</strong> (<em>array</em>) -- List entries</li>
<li><strong>$attributes</strong> (<em>array</em>) -- HTML attributes</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML-formatted ordered list</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>和 <a class="reference internal" href="#ul" title="ul"><tt class="xref php php-func docutils literal"><span class="pre">ul()</span></tt></a> 函数一样，只是它生成的是有序列表（ &lt;ol&gt; ）。</p>
</dd></dl>

<dl class="function">
<dt id="meta">
<tt class="descname">meta</tt><big>(</big><span class="optional">[</span><em>$name = ''</em><span class="optional">[</span>, <em>$content = ''</em><span class="optional">[</span>, <em>$type = 'name'</em><span class="optional">[</span>, <em>$newline = &quot;n&quot;</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#meta" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$name</strong> (<em>string</em>) -- Meta name</li>
<li><strong>$content</strong> (<em>string</em>) -- Meta content</li>
<li><strong>$type</strong> (<em>string</em>) -- Meta type</li>
<li><strong>$newline</strong> (<em>string</em>) -- Newline character</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML meta tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于生成 meta 标签，你可以传递一个字符串参数，或者一个数组，或者一个多维数组。</p>
<p>例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">,</span> <span class="s1">&#39;My Great site&#39;</span><span class="p">);</span>
<span class="c1">// Generates:  &lt;meta name=&quot;description&quot; content=&quot;My Great Site&quot; /&gt;</span>

<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="s1">&#39;Content-type&#39;</span><span class="p">,</span> <span class="s1">&#39;text/html; charset=utf-8&#39;</span><span class="p">,</span> <span class="s1">&#39;equiv&#39;</span><span class="p">);</span>
<span class="c1">// Note the third parameter.  Can be &quot;equiv&quot; or &quot;name&quot;</span>
<span class="c1">// Generates:  &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</span>

<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;robots&#39;</span><span class="p">,</span> <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;no-cache&#39;</span><span class="p">));</span>
<span class="c1">// Generates:  &lt;meta name=&quot;robots&quot; content=&quot;no-cache&quot; /&gt;</span>

<span class="nv">$meta</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;robots&#39;</span><span class="p">,</span>
        <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;no-cache&#39;</span>
    <span class="p">),</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;description&#39;</span><span class="p">,</span>
        <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;My Great Site&#39;</span>
    <span class="p">),</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;keywords&#39;</span><span class="p">,</span>
        <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;love, passion, intrigue, deception&#39;</span>
    <span class="p">),</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;robots&#39;</span><span class="p">,</span>
        <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;no-cache&#39;</span>
    <span class="p">),</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Content-type&#39;</span><span class="p">,</span>
        <span class="s1">&#39;content&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;text/html; charset=utf-8&#39;</span><span class="p">,</span> <span class="s1">&#39;type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;equiv&#39;</span>
    <span class="p">)</span>
<span class="p">);</span>

<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="nv">$meta</span><span class="p">);</span>
<span class="c1">// Generates:</span>
<span class="c1">// &lt;meta name=&quot;robots&quot; content=&quot;no-cache&quot; /&gt;</span>
<span class="c1">// &lt;meta name=&quot;description&quot; content=&quot;My Great Site&quot; /&gt;</span>
<span class="c1">// &lt;meta name=&quot;keywords&quot; content=&quot;love, passion, intrigue, deception&quot; /&gt;</span>
<span class="c1">// &lt;meta name=&quot;robots&quot; content=&quot;no-cache&quot; /&gt;</span>
<span class="c1">// &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="doctype">
<tt class="descname">doctype</tt><big>(</big><span class="optional">[</span><em>$type = 'xhtml1-strict'</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#doctype" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$type</strong> (<em>string</em>) -- Doctype name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML DocType tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>用于生成 DTD （文档类型声明，document type declaration），默认使用的是 XHTML 1.0 Strict ，但是你也可以选择其他的。</p>
<p>例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">doctype</span><span class="p">();</span> <span class="c1">// &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>

<span class="k">echo</span> <span class="nx">doctype</span><span class="p">(</span><span class="s1">&#39;html4-trans&#39;</span><span class="p">);</span> <span class="c1">// &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span>
</pre></div>
</div>
<p>下表是可选的文档类型，它是可配置的，你可以在 application/config/doctypes.php 文件中找到它。</p>
<table border="1" class="docutils">
<colgroup>
<col width="16%" />
<col width="10%" />
<col width="74%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">文档类型</th>
<th class="head">选项</th>
<th class="head">结果</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>XHTML 1.1</td>
<td>xhtml11</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>XHTML 1.0 Strict</td>
<td>xhtml1-strict</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>XHTML 1.0 Transitional</td>
<td>xhtml1-trans</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>XHTML 1.0 Frameset</td>
<td>xhtml1-frame</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>XHTML Basic 1.1</td>
<td>xhtml-basic11</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML Basic 1.1//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>HTML 5</td>
<td>html5</td>
<td>&lt;!DOCTYPE html&gt;</td>
</tr>
<tr class="row-even"><td>HTML 4 Strict</td>
<td>html4-strict</td>
<td>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/html4/strict.dtd">http://www.w3.org/TR/html4/strict.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>HTML 4 Transitional</td>
<td>html4-trans</td>
<td>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>HTML 4 Frameset</td>
<td>html4-frame</td>
<td>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/html4/frameset.dtd">http://www.w3.org/TR/html4/frameset.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>MathML 1.01</td>
<td>mathml1</td>
<td>&lt;!DOCTYPE math SYSTEM &quot;<a class="reference external" href="http://www.w3.org/Math/DTD/mathml1/mathml.dtd">http://www.w3.org/Math/DTD/mathml1/mathml.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>MathML 2.0</td>
<td>mathml2</td>
<td>&lt;!DOCTYPE math PUBLIC &quot;-//W3C//DTD MathML 2.0//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">http://www.w3.org/Math/DTD/mathml2/mathml2.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>SVG 1.0</td>
<td>svg10</td>
<td>&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.0//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>SVG 1.1 Full</td>
<td>svg11</td>
<td>&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>SVG 1.1 Basic</td>
<td>svg11-basic</td>
<td>&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1 Basic//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>SVG 1.1 Tiny</td>
<td>svg11-tiny</td>
<td>&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1 Tiny//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>XHTML+MathML+SVG (XHTML host)</td>
<td>xhtml-math-svg-xh</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>XHTML+MathML+SVG (SVG host)</td>
<td>xhtml-math-svg-sh</td>
<td>&lt;!DOCTYPE svg:svg PUBLIC &quot;-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN&quot; &quot;http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd&quot;&gt;</td>
</tr>
<tr class="row-odd"><td>XHTML+RDFa 1.0</td>
<td>xhtml-rdfa-1</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML+RDFa 1.0//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd</a>&quot;&gt;</td>
</tr>
<tr class="row-even"><td>XHTML+RDFa 1.1</td>
<td>xhtml-rdfa-2</td>
<td>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML+RDFa 1.1//EN&quot; &quot;<a class="reference external" href="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd</a>&quot;&gt;</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="br">
<tt class="descname">br</tt><big>(</big><span class="optional">[</span><em>$count = 1</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#br" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$count</strong> (<em>int</em>) -- Number of times to repeat the tag</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">HTML line break tag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>根据指定的个数生成多个换行标签（ &lt;br /&gt; ）。
例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">br</span><span class="p">(</span><span class="mi">3</span><span class="p">);</span>
</pre></div>
</div>
<p>上面的代码将生成：</p>
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;br</span> <span class="nt">/&gt;&lt;br</span> <span class="nt">/&gt;&lt;br</span> <span class="nt">/&gt;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">该函数已经废弃，请使用原生的 <tt class="docutils literal"><span class="pre">str_repeat()</span></tt> 函数代替。</p>
</div>
</dd></dl>

<dl class="function">
<dt id="nbs">
<tt class="descname">nbs</tt><big>(</big><span class="optional">[</span><em>$num = 1</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#nbs" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$num</strong> (<em>int</em>) -- Number of space entities to produce</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">A sequence of non-breaking space HTML entities</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>根据指定的个数生成多个不换行空格（&amp;nbsp;）。
例如:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">echo</span> <span class="nx">nbs</span><span class="p">(</span><span class="mi">3</span><span class="p">);</span>
</pre></div>
</div>
<p>上面的代码将生成：</p>
<div class="highlight-html"><div class="highlight"><pre><span class="ni">&amp;nbsp;&amp;nbsp;&amp;nbsp;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">该函数已经废弃，请使用原生的 <tt class="docutils literal"><span class="pre">str_repeat()</span></tt> 函数代替。</p>
</div>
</dd></dl>

</div>
</div>


          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="inflector_helper.html" class="btn btn-neutral float-right" title="Inflector 辅助函数">下一个主题 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="form_helper.html" class="btn btn-neutral" title="表单辅助函数"><span class="fa fa-arrow-circle-left"></span> 上一个主题</a>
      
    </div>
  

  
  <div id="notes">
  
  <!-- 多说评论框 start -->
    <div class="ds-thread" data-thread-key="userguide3/helpers/html_helper" data-title="HTML 辅助函数" data-url="http://codeigniter.org.cn/user_guide/helpers/html_helper.html"></div>
  <!-- 多说评论框 end -->
  

  <div class="ds-share flat" data-thread-key="userguide3/helpers/html_helper" data-title="HTML 辅助函数 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" data-url="http://codeigniter.org.cn/user_guide/helpers/html_helper.html" data-images="" data-content="">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">

        <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
  </div>

  <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
  <script type="text/javascript">
    var duoshuoQuery = {short_name:"codeigniter"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0]
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
  <!-- 多说公共JS代码 end -->
  </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; 版权所有 2014 - 2015, 不列颠哥伦比亚理工学院.
       最后修改: 2015-10-11.
    </p>

    <p>以 <a href="http://www.aneasystone.com/" target="_blank">aneasystone</a> 制作的手册为基础构建</p>
  </div>

  
    <p>基于 <a href="http://sphinx-doc.org/">Sphinx</a> 并使用 <a href="https://readthedocs.org">Read the Docs</a> 提供的<a href="https://github.com/snide/sphinx_rtd_theme">风格</a>构建</p>
    <p>
        <a href="https://github.com/CodeIgniter-Chinese/codeigniter-user-guide" target="_blank">Github 简体中文翻译</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/codeigniter_user_guide.zip">离线版压缩包下载</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/CodeIgniter.pdf">PDF 版下载</a>
    </p>
  

</footer>
        </div>
      </div>

    </section>

  </div>
  

  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../',
            VERSION:'3.0.2',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  false
        };
    </script>
      <script type="text/javascript" src="../_static/jquery.js"></script>
      <script type="text/javascript" src="../_static/underscore.js"></script>
      <script type="text/javascript" src="../_static/doctools.js"></script>
      <script type="text/javascript" src="../_static/translations.js"></script>

  

  
  
    <script type="text/javascript" src="../_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

  
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-272152-3', 'auto');
        ga('send', 'pageview');
    </script>
  

</body>
</html>